import bus from '@/bus'
import { renderButton } from '@/util'
let data = {
  status: 'pass',
  columns: [{
    title: '职能名称',
    key: 'roleName',
    align: 'left',
    minWidth: 250
  }, {
    title: '职能归类',
    key: 'roleTypeStr',
    align: 'left',
    minWidth: 200
  }, {
    title: '数据依据',
    key: 'roleManageTypeStr',
    align: 'left',
    minWidth: 200,
    renderHeader: (h, params) => {
      let oDiv = h('div', [
        h('span', '数据依据'),
        h('Icon', {
          props: {
            type: 'ios-help-circle'
          }
        })
      ])
      return h('Tooltip', {
        style: {
          cursor: 'pointer'
        },
        props: {
          'max-width': "200",
          transfer: true,
          content: '该角色的门店数据依据'
        }
      }, [oDiv])
    }
  }, {
    title: '创建人',
    key: 'operator',
    align: 'left',
    minWidth: 200
  }, {
    title: '创建时间',
    key: 'createDate',
    align: 'left',
    minWidth: 200
  }, {
    title: '操作',
    align: 'right',
    minWidth: 200,
    render: (h, params) => {
      return (
        <div>
          { renderButton(h, { text: '查看' },
            ()=>{ bus.$emit('onCheck', params.row.id) })}
          { renderButton(h, { text: '编辑', type: 'primary' },
            ()=>{ bus.$emit('onEdit', params.row.id) })}
        </div>
      )
    }
  }],
  current: 1,
  pageSize: window.$pageSize,
  total: 1,
  data: []
}
export default data